package com.market.service.wx.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.market.bean.MarketCollect;
import com.market.bean.MarketOrderExample;
import com.market.bean.common.BasePageInfo;
import com.market.bean.common.CommonData;
import com.market.bean.vo.wx.WxCollectVo;
import com.market.mapper.MarketCollectMapper;
import com.market.mapper.MarketGoodsMapper;
import com.market.service.wx.WxCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author tan
 * @date 2023年01月01日 23:00
 */
@Component
public class WxCollectServiceImpl implements WxCollectService {
    @Autowired
    MarketCollectMapper collectMapper;

    @Override
    public CommonData<WxCollectVo> list(Byte type, Integer page, Integer limit) {

        PageHelper.startPage(page, limit);
        MarketOrderExample marketOrderExample = new MarketOrderExample();
        MarketOrderExample.Criteria criteria = marketOrderExample.createCriteria();
        criteria.andDeletedEqualTo(false);
        List<WxCollectVo> list = collectMapper.selectCollectByTables();
        PageInfo<WxCollectVo> pageInfo = new PageInfo<>(list);
        return CommonData.data(pageInfo);
    }
}
